package com.masterclient.app.businessmodule.vipmodule.financial_management.contract;


import com.eoner.baselib.container.CommonBaseResponse;
import com.eoner.baselib.presenter.FCBaseCallBack;
import com.masterclient.app.businessmodule.vipmodule.financial_management.api.FinancialService;
import com.masterclient.app.businessmodule.vipmodule.financial_management.bean.RechargeRecordData;


public class RechargeRecordPresenter extends RechargeRecordContract.Presenter {
    @Override
    public void getData(int page,String withdraw_sourch) {
        mRxManager.add(toNewSubscribe(/*TextUtils.isEmpty(withdraw_sourch)? FinancialService.getInstance().rechargeRecord(page)
                :*/FinancialService.getInstance().cashRecord(page,withdraw_sourch), new FCBaseCallBack<CommonBaseResponse<RechargeRecordData>>() {
            @Override
            public void onSuccess(CommonBaseResponse<RechargeRecordData> obj) {
                mView.showData(obj.getData());
            }

            @Override
            public void onServiceError(CommonBaseResponse<RechargeRecordData> obj) {
                super.onServiceError(obj);
                mView.failureData(SERVER_FAILED_STR);
            }

            @Override
            public void onNetWorkError(String errorMsg) {
                super.onNetWorkError(errorMsg);
                mView.failureData(WEB_FAILED_STR);
            }
        }));
    }
}
